package cn.zz.veggie.application.helper;

import cn.zz.comm.exception.classes.AccountPasswordErrorException;
import cn.zz.veggie.model.domain.Admin;

/**
 * @author zhongq
 * @since 2024/5/13
 */
public class AdminHelper {


    public static void matchByLogin(Admin admin, String account, String password) {
        if (admin == null) {
            throw new AccountPasswordErrorException();
        }
        if (!admin.matchPassword(password)) {
            throw new AccountPasswordErrorException();
        }
    }
}